<@t.plat_body pageid="pays">
<script type="text/javascript" src="${base}/js/plugins/datatables/datatables.min.js"></script>
<script type="text/javascript" src="${base}/js/plugins/datatables/datatables_basic.js"></script>
<div class="panel panel-flat">
    <div class="panel-heading">
        <h5 class="panel-title">支付方式</h5>
        <div class="heading-elements">
            <!--<a href="javascript:void(0)" class="btn btn-primary" onclick="dialogBox('${base}/plat/platform/editPays', '添加支付方式', 500, 240);"><i class="icon-add position-left"></i>添加</a>-->
        </div>
    </div>

    <table class="table table-striped table-bordered datatable-basic" id="userTable">
    </table>
</div>
<script>
    function delRec(id) {
        createConfirm('您确定要删除该数据',function() {
            post('pl/platform/delPays/'+id,function (result) {
                if(result.code==0){
                    table.ajax.reload();
                }else{
                    alertError(result.message);
                }
            });
        });
    }
    var table;
    $(function () {
        table=simpleTable('userTable', [
            {
                dataIndex: 'code',
                title: "支付方式编号"
            },
            {
                dataIndex: 'name',
                title: "支付方式名称"
            },
            {
                dataIndex: 'flag',
                title: "是否启用",
                render:function (data) {
                    return (data=='0')?"否":"是";
                }
            },
            {
                title: "操作",
                dataIndex: 'code',
                sClass:'text-center',
                render: function (data, type, full) {
                    var html = '<div><a style="margin-left: 2px" onclick="dialogBox(\'${base}/plat/platform/editPays?code='+data+'\', \'编辑支付方式\', 500, 240);" class="btn btn-success btn-xs btn-outline">设置</a>';
//                        html+='<a href="javascript:void(0)" style="margin-left: 2px" onclick="delRec(\''+data+'\')" class="btn btn-primary btn-xs btn-outline">删除</a>'
                    html+='</div>';
                    return html;
                }
            }
        ], {
            searching: true,
            bLengthChange: false,
            bSort: false,
            url: '${base}/pl/platform/listPays',
            pageLength: 25

        });
    });
</script>
</@t.plat_body>
